package com.oo.inherit_3.solider;

/**
 * Solider--${description}
 *
 * @author: Jovi
 * @createTime: 2017-05-09 14:37
 **/
public class Solider extends Person{

    private int year;

    private String army;

    public Solider() {
    }

    public Solider(String name, int age, String sex, String duty, int year, String army) {
        super(name, age, sex, duty);
        this.year = year;
        this.army = army;
    }

    @Override
    protected void work() {
        System.out.println("姓名："+this.getName()
        +"\n职业：军人\n年龄："+this.getAge()
        +"\n所属部队："+this.getArmy()
        +"\n职务："+this.getDuty()
        +"\n军龄："+this.getYear());
    }

    public int getYear() {
        return year;
    }

    public void setYear(int year) {
        this.year = year;
    }

    public String getArmy() {
        return army;
    }

    public void setArmy(String army) {
        this.army = army;
    }
}
